/**
 * 
 */
package hihocoder;

import java.util.ArrayList;
import java.util.Scanner;

/**
 * @author zhongfang
 *
 */
public class 偶树的切分 {

	static class Node {
		ArrayList<Node> neibors = new ArrayList<>();
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		Node nodes[] = new Node[N + 1];
		for (int i = 1; i < nodes.length; i++) {
			nodes[i] = new Node();
		}
		for (int i = 0; i < N - 1; i++) {
			int a = scanner.nextInt();
			int b = scanner.nextInt();
			Node parent = nodes[a];
			Node child = nodes[b];
			parent.neibors.add(child);
			child.neibors.add(parent);
		}
		// 找到根
		Node root = nodes[1];
		getRes(root, null);
		System.out.println(res);
	}

	static int res = 0;

	/**
	 * 
	 * @param root
	 * @return 节点个数
	 */
	private static int getRes(Node root, Node from) {
//		if (root == null) {
//			return 0;
//		}
		int count = 1;// 自己节点
		ArrayList<Node> child = root.neibors;
		for (Node node : child) {
			if (node == from) {
				continue;
			}
			int c = getRes(node, root);
			if ((c & 1) == 0) {// 偶数个
				res++;
			} else {
				count += c;
			}
		}
		return count;
	}
}
